<template>
    <div class="ec-app-container">
        <!-- 查询条件 -->
        <div class="filter-container">
            <el-input placeholder="" v-model="listQuery.title" style="width: 200px;" class="filter-item"/>
            <el-button class="filter-item" type="primary" icon="el-icon-search" @click="searchList">搜索</el-button>
            <el-button class="filter-item" @click="resetSearch">重置</el-button>
        </div>
        <!-- table -->
        <div>
            <div class="mt-30">
                <el-button class="filter-item" type="primary" @click="searchList">批量改价</el-button>
                <el-button class="filter-item" type="primary" @click="searchList">批量上架</el-button>
                <el-button class="filter-item" type="primary" @click="searchList">批量下架</el-button>
                <el-button class="filter-item" type="primary" @click="searchList">批量移除</el-button>
                <el-button class="filter-item" type="primary" @click="handleDownload">导出商品</el-button>
            </div>
            <div class="mt-20">
                <el-table
                        v-loading="listLoading"
                        :key="tableKey"
                        :data="list"
                        border
                        fit
                        highlight-current-row
                        @selection-change="handleSelectionChange"
                        style="width: 100%;">
                    <el-table-column
                            type="selection"
                            width="55"/>
                    <el-table-column label="商品名称" prop="id" align="center">
                        <template slot-scope="scope">
                            <span>{{ scope.row.id }}</span>
                        </template>
                    </el-table-column>
                    <el-table-column label="商品来源" prop="id" align="center">
                        <template slot-scope="scope">
                            <span>{{ scope.row.id }}</span>
                        </template>
                    </el-table-column>
                    <el-table-column label="市场价" prop="id" align="center">
                        <template slot-scope="scope">
                            <span>{{ scope.row.id }}</span>
                        </template>
                    </el-table-column>
                    <el-table-column label="分销价" prop="id" align="center">
                        <template slot-scope="scope">
                            <span>{{ scope.row.id }}</span>
                        </template>
                    </el-table-column>
                    <el-table-column label="总库存" prop="id" align="center">
                        <template slot-scope="scope">
                            <span>{{ scope.row.id }}</span>
                        </template>
                    </el-table-column>
                    <el-table-column label="总销量" prop="id" align="center">
                        <template slot-scope="scope">
                            <span>{{ scope.row.id }}</span>
                        </template>
                    </el-table-column>
                    <el-table-column label="状态" prop="id" align="center">
                        <template slot-scope="scope">
                            <span>{{ scope.row.id }}</span>
                        </template>
                    </el-table-column>
                    <el-table-column :label="$t('table.actions')" align="center" width="230" class-name="small-padding fixed-width">
                        <template slot-scope="scope">
                            <el-button type="primary" size="mini" @click="handleUpdate(scope.row)"></el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </div>
            <pagination v-show="total>0" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" @pagination="searchList" />
        </div>
    </div>
</template>

<script>
    import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
    export default {
        name: 'Shop',
        components: {
            Pagination
        },
        data() {
            return {
                listLoading: false,
                total: 0,
                listQuery: {
                    title: '',
                    pageSize: 10,
                    pageNum: 1
                },
                multipleSelection: []
            }
        },
        methods: {
            searchList() {

            },
            getList() {

            },
            // 选择复选框
            handleSelectionChange(val) {
                this.multipleSelection = val
                // this.userIds = _.map(this.multipleSelection, 'userId')
            }
        }
    }
</script>

<style scoped>

</style>